package test.test1;

import java.io.InputStream;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import test.test1.mybatis.pojo.Question;
import test.test1.mybatis.pojo.Player;

/**
 * Hello world!
 *
 */
public class NoSpring 
{
    public static void main( String[] args )
    {
    	firstDemo();
    	springDemo();
    }
    
    private static void firstDemo() {
    	Player player = new Player();
    	player.setId(1);
    	player.setNickname("nick");
    	player.setScore(40);
    	Question q = new Question();
    	q.setId(4);
    	q.setCredit(10);
    	q.setIsOpen("Y");
    	q.setPlayer(player);
    }
    
    private static void springDemo() {
    	ApplicationContext context =
    		    new ClassPathXmlApplicationContext(new String[] {"spring1.xml"});
    	Question q = context.getBean("question", Question.class);
    	System.out.println(q);
    	System.out.println(q.getPlayer());
    }
    
}
